package day05;

/**
 * 数组演示
 */
public class ArrayDemo {
    public static void main(String[] args) {
        /**int[] arr=new int[3];
        arr[0] =100;
        arr[1]=200;
        arr[2]=300;
        System.out.println(arr[arr.length-1]);
        System.out.println(arr[2]);
        //arr[4]=400;运行时报错，数组下标越界
        int[] arr2=new int[4];
        System.out.println(arr2[arr2.length-1]);
        arr2[2]=100;
        arr2[3]=300;
        System.out.println(arr2[3]);
        System.out.println(arr2[2]);
         **/

        int[] arr=new int[10];
        for (int i=0; i<arr.length; i++){
            arr[i]=(int)(Math.random()*100);
            System.out.println(arr[i]);
        }
    }
}
